import {
  tbType
} from "./tbType";

const jsPlumbSetting = {
  grid: [10, 10],
  // 动态锚点、位置自适应
  Anchors: [
    "TopCenter",
    "RightMiddle",
    "BottomCenter",
    "LeftMiddle"
  ],
  Container: "flow",
  // 连线的样式四种类型：Bezier（贝塞尔曲线）/Straight（直线）/Flowchart（流程图）/StateMachine（状态机）
  Connector: ['Bezier'],
  // 连线的端点
  Endpoint: ["Dot", {
    radius: 1,
  }],
  // 端点的样式
  // EndpointStyle: {
  //   fill: "#c4c4c4",
  //   outlineWidth: 1
  // },
  // 绘制线
  PaintStyle: {
    stroke: tbType["Union"].color,
    strokeWidth: 2
  },
  // 鼠标经过链接线时的样式
  HoverPaintStyle: {
    stroke: tbType["RS"].color,
    strokeWidth: 2
  },
  maxConnections: -1, // 设置连接点最多可以连接几条线 -1不限
  // 绘制箭头
  Overlays: [
    [
      "Arrow",
      {
        width: 8,
        length: 10,
        location: 1
      }
    ]
  ],
  LogEnabled: false, //是否打开jsPlumb的内部日志记录
  ReattachConnections: true, //是否重新连接使用鼠标分离的线
}

export default jsPlumbSetting